package org.example.controller;


import org.example.pojo.UmsRolePermission;
import org.example.service.IUmsRolePermissionService;
import org.example.util.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 角色权限 前端控制器
 * </p>
 *
 * @author wy
 * @since 2023-10-04
 */
@RestController
@RequestMapping("/ums-role-permission")
public class UmsRolePermissionController {
    @Resource
    IUmsRolePermissionService umsRolePermissionService;
    @GetMapping("/get-permiss")
    CommonResult getPermiss() {
        return CommonResult.success(umsRolePermissionService.getPermission());
    }
    @PostMapping("/save")
    CommonResult save(UmsRolePermission umsRolePermission) {
        return CommonResult.success(umsRolePermissionService.saveOrUpdate(umsRolePermission));
    }
    @GetMapping("/getByRoleId")
    CommonResult getByRoleId(Integer roleId) {
        return CommonResult.success(umsRolePermissionService.getByRoleId(roleId));
    }
}
